package data;

import java.io.BufferedReader;
import java.io.FileReader;
import java.util.HashSet;

public class TrainTestPaperRetrieval {

	public static HashSet<String> retrieveTrain(String user) throws Exception {
		HashSet<String> trainPapers = new HashSet<String>();
		String path = "D:\\CityU\\project\\bibsonomy\\experiment\\" + user
				+ "\\train.txt";
		BufferedReader reader = new BufferedReader(new FileReader(path));
		String line = null;
		while ((line = reader.readLine()) != null) {
			line = line.trim();
			trainPapers.add(line);
		}
		reader.close();
		return trainPapers;
	}

	public static HashSet<String> retrieveTest(String user) throws Exception {
		HashSet<String> holdoutPapers = new HashSet<String>();
		String path = "D:\\CityU\\project\\bibsonomy\\experiment\\" + user
				+ "\\test.txt";
		BufferedReader reader = new BufferedReader(new FileReader(path));
		String line = null;
		while ((line = reader.readLine()) != null) {
			line = line.trim();
			holdoutPapers.add(line);
		}
		reader.close();
		return holdoutPapers;
	}

}
